'use strict';

const Controller = require('egg').Controller;

class StudentController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = '<h1>StudentController</h1>';
  }

  // 学生信息注册
  async register() {
   const { ctx } = this;
   const data = await ctx.service.student.register()
   ctx.body = data;
  }

  // 学生登陆
  async login() {
    const { ctx } = this;
    const data = await ctx.service.student.login()
    ctx.body = data;
  }
  
  // 查询分页
  async findByStuId() {
    const { ctx } = this;
    const data = await ctx.service.student.findByStuId()
    ctx.body = data;
  }

  // async test() {
  //   this.ctx.body = this.ctx.params.type;
  // }
}

module.exports = StudentController;
